<?php
/**
 * @copyright 
 * @license https://opensource.org/licenses/Apache-2.0
 * @link https://www.gougucms.com
 */

declare (strict_types = 1);

namespace app\home\controller;

use app\home\BaseController;
use think\facade\View;
use think\facade\Db;

class Index
{
    public function index()
    {

        return View('');
    }
	
    public function logs()
    {
        add_user_log('view', '开发日志');
        return View('');
    }

	public function down()
    {
        $version = CMS_VERSION;
        add_user_log('down', $version.'版本代码');
        header("Location: https://www.gougucms.com/storage/gougucms_v".$version."_full.zip");
        //确保重定向后，后续代码不会被执行
        exit;
    }
    
         /** 隐私协议外部页面 */
    public function privacyText()
    {
        $data = Db::name('config')->where('id',8)->find();
        $conf = unserialize($data['content']);
        View::assign('conf', $conf);
        return View::fetch();
    }

    /** 用户协议外部页面 */
    public function userText()
    {
        $data = Db::name('config')->where('id',8)->find();
        $conf = unserialize($data['content']);
        $conf['fuwu'] = str_replace('src="/storage','src="'.request()->domain().'/storage',$conf['fuwu']);
        View::assign('conf', $conf);
        return View::fetch();
    }
}
